<template>
	<view class="cell-item" :class="{'border-top':borderTop,'border-bottom':borderBottom}"  @click="jump">
		<view class="icon-box" v-if="icon != null">
			<image class="icon" :src="icon" mode="aspectFit"></image>
		</view>
		<view class="title">
			{{title}}
		</view>
		
		<view class="right-box">
			<view class="value-box" v-if="value != null">
				{{value}}
			</view>
			<image class="icon" v-if="rightIcon" src="/static/image/more_right_icon.png" mode="aspectFit"></image>
		</view>
	</view>
</template>

<script>
	export default {
		props:{
			icon:{ // icon图标路径
				type:String,
				default:null,
			},
			title:{ // 标题
				type:String,
				default:null,
			},
			value:{ // 内容值
				type:String,
				default:null,
			},
			rightIcon:{ // 右跳转图标
				type:Boolean,
				default:true,
			},
			borderTop:{ // 头部直线
				type:Boolean,
				default:false,
			},
			borderBottom:{ // 尾部直线
				type:Boolean,
				default:false,
			},
			name:{ // 传参值
				type:String,
				default:null,
			},
		},
		data() {
			return {
				
			}
		},
		methods: {
			jump:function(){
				this.$emit('jump',this.name);
			},
		}
	}
</script>

<style lang="scss" scoped>
	.cell-item{
		background-color: white;
		width:100%;
		box-sizing: border-box;
		padding: 0 20rpx;
		display: flex;
		height: 100rpx;
		overflow: hidden;
		position: relative;
		.icon-box{
			width: 50rpx;
			height: 50rpx;
			margin: 25rpx 0;
			.icon{
				width: 100%;
				height: 100%;
			}
		}
		.title{
			margin-left: 20rpx;
			line-height: 100rpx;
			font-size: 30rpx;
		}
		
		.right-box{
			right: 20rpx;
			display: flex;
			position: absolute;
			.value-box{
				line-height: 100rpx;
				font-size: 30rpx;
			}
			.icon{
				margin-top: 30rpx;
				width: 40rpx;
				height: 40rpx;
			}
		}
	}
	.border-top{
		border-top: 1px solid #dbdbdb;
	}
	.border-bottom{
		border-bottom: 1px solid #dbdbdb;
	}
</style>
